﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using _1._7._2015_EF_Persons.Data.Model;
using System.Data.Entity.Migrations; // have to be added, VS can't find on its own

namespace _1._7._2015_EF_Persons.Data
{
    public static class Seeder
    {
        public static void Seed(PersonsDbContext db)
        {
            db.Persons.AddOrUpdate(p => new { p.FirstName, p.LastName },
                new Person
                {
                    FirstName = "Louis",
                    LastName = "Murphy"
                },
            new Person
            {
                FirstName = "Shelbu",
                LastName = "Murphy"
            },
            new Person
            {
                FirstName = "Jettin",
                LastName = "Murphy"
            },
            new Person
            {
                FirstName = "Maverick",
                LastName = "Murphy"
            }
                );
            db.SaveChanges();
        }
    }
}
